﻿<%@ Page Title="" Language="C#" ValidateRequest="false" MasterPageFile="~/Template/Detail.master"
    AutoEventWireup="true" CodeBehind="Three1Detail.aspx.cs" Inherits="MaluJg.web.Three.Three1Detail" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <script src="../Scripts/uploadify/swfobject.js" type="text/javascript"></script>

    <script src="../Scripts/uploadify/jquery.uploadify.js" type="text/javascript"></script>

    <script>
        $(document).ready(function() {
            if ($("#<%=tbInstances.ClientID %>").val() == '') {
                addNew2();
                addNew2();
                addNew2();
                addNew2();

            }
            else {
                init();
            }
            initAtt();
            initUpload();
        });
        function init() {
            var arr = $("#<%=tbInstances.ClientID %>").val().split(';');
            for (var i = 0; i < arr.length; i++) {
                addNew2();
                var type = $("#" + (i + 1).toString() + (2).toString()).get(0).type;
                if (type.toLowerCase() == 'text') {

                    $("#" + (i + 1).toString() + (2).toString()).val(arr[i].replace(/@1/g, ';').replace(/@2/g, '|'));
                }
            }
        }
        function deleteTr(obj) {
            $(obj).parent().parent().remove();
        }
        function addNew2() {
            var last = $("#tbl >tbody> tr[name='template2']").last();
            var max = 1;
            if (last.html() != null) {

                max = parseInt(last.get(0).childNodes[1].innerHTML) + 1;
            }

            $("#tr2").before($("#template2>tbody").html().replace(/t0/ig, max));
        }
        function initUpload() {
            if ('<%=CanUpload %>' == '0') {
                $('#file_upload').uploadify({
                    'width': 60,
                    'height': 20,
                    'uploader': '../Scripts/uploadify/uploadify.swf',
                    'script': '../Common/UploadFile.ashx',
                    'cancelImg': '../Scripts/uploadify/cancel.png',
                    'folder': '/uploads',
                    'auto': true,
                    'multi': true,
                    'simUploadLimit': 5,
                    'buttonImg': '../Images/Upload.gif',
                    'method': 'post',

                    'onComplete': function(event, ID, fileObj, response, data) {

                        $("#ulAtt").append("<li id=\"" + response + "\" ><a target=\"_blank\" href=\"../common/GetAttach.aspx?id=" + response + "\">" + fileObj.name + "</a>&nbsp;&nbsp;<span  onclick=\"delAtt(this)\">[删除]</span></li>");
                        $("#ulAtt > li").each(function() {
                            $(this).attr("title", $(this).children(0).html());
                        }
                    );
                    },
                    'onError': function(event, queueID, fileObj) {
                        alert("文件:" + fileObj.name + " 上传失败");
                    }
                });
            }
        }
        function delAtt(obj) {
            $(obj).parent().remove();
        }
        function initAtt() {
            $("#ulAtt").html("");
            $("#ulAtt").append($("#<%=tbAttaches.ClientID %>").val());
            $("#ulAtt > li").each(function() {
                $(this).attr("title", $(this).children(0).html());
            });

        }
        function check() {
            if (window.confirm('确认提交?')) {
                var ids = '';
                $("#ulAtt >li").each(function() {

                    ids += "," + $(this).attr("id");
                }); if (ids != '')
                    ids = ids.substring(1, ids.length);

                $("#<%=tbAttachIDs.ClientID %>").val(ids);


                var tmp = '';
                $("#tbl >tbody>tr[name='template2']").each(function() {
                    var trObj = $(this).get(0);
                    tmp += ';' + trObj.childNodes[2].childNodes[0].value.replace(/\|/g, '@2');

                });

                $("#<%=tbInstances.ClientID %>").val(tmp);
                return true;
            }
        }
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ListToolBarPlaceHolder" runat="server">
    <table cellspacing="2" cellpadding="0" border="0" id="tblOperator" runat="server">
        <tr>
            <td class="ToolMenu" id="tdstart" runat="server">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                    <asp:LinkButton runat="server" ID="btnStart" OnClick="btnSubmit_Click" OnClientClick="return check();">
                    <span><img src="../Images/Icon/Object/File-add.gif" /></span><span>提交</span></asp:LinkButton>
                </div>
            </td>
            <td class="Fg" id="tdstartfg" runat="server">
                <img src="../Images/FgLine.gif" alt="" />
            </td>
            <td class="ToolMenu" id="tdfinish" runat="server">
                <div class="Normal" oldclass="Normal" onmouseover="OverChangeClass(this);" onmouseout="ReturnClass(this)">
                    <asp:LinkButton runat="server" ID="btnFinish" OnClick="btnDelete_Click" OnClientClick="return window.confirm('确认删除?');">
                    <span><img src="../Images/Icon/Object/File-delete.gif" /></span><span>删除</span></asp:LinkButton>
                </div>
            </td>
        </tr>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TitleContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="InfoContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="TextContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="TabberContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content7" ContentPlaceHolderID="Div1ContentPlaceHolder" runat="server">
    <div class="Section1" style='text-align: center; margin: 0px;'>
        <div style="display: none">
            <asp:TextBox runat="server" ID="tbAttachIDs"></asp:TextBox>
            <asp:TextBox runat="server" ID="tbInstances"></asp:TextBox>
            <asp:TextBox runat="server" ID="tbAttaches"></asp:TextBox></div>
        <table border="0" cellspacing="0" cellpadding="0" width="624" id="tbl" style='border-collapse: collapse;'>
            <tr style='height: 57.85pt'>
                <td width="624" colspan="3" style='border: none; padding: 0cm 5.4pt 0cm 5.4pt; height: 57.85pt'>
                    <p align="center" style='text-align: center;'>
                        <b><span style='font-size: 18.0pt; font-family: 黑体;'>“三重一大”事项备案表<span lang="EN-US"><o:p></o:p></span></span></b></p>
                </td>
            </tr>
            <tr style='height: 30pt'>
                <td width="50" style="border-top: none;">
                    <%if (CanUpload == "0")
                      { %>
                    <input type="button" class="Button01" onclick="addNew2()" value="增加" /><%}
                      { %>&nbsp;
                    <%} %>
                </td>
                <td width="50" style='border: solid windowtext 1.0pt; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    <p align="center">
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>上报单位</span></p>
                </td>
                <td style='border-left: none; border: solid windowtext 1.0pt; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    <p align="center">
                        <asp:TextBox runat="server" ID="tbDept" Width="98%" CssClass="TextboxLine" MaxLength="30"></asp:TextBox>
                    </p>
                </td>
            </tr>
            <tr style='height: 30pt'>
                <td>
                    &nbsp;
                </td>
                <td style='border: solid windowtext 1.0pt; border-top: none; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    <p align="center">
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>上报时间</span></p>
                </td>
                <td style='border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt;
                    border-right: solid black 1.0pt; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    <p align="center">
                        <asp:TextBox runat="server" ID="tbReportTime" Width="98%" CssClass="TextboxLine"
                            MaxLength="10"></asp:TextBox>
                    </p>
                </td>
            </tr>
            <tr style='height: 26.5pt'>
                <td>
                    &nbsp;
                </td>
                <td style='border: solid windowtext 1.0pt; border-top: none; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    <p align="center" style='text-align: center;'>
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>序号</span></p>
                </td>
                <td style='border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt;
                    border-right: solid black 1.0pt; padding: 0cm 5.4pt 0cm 5.4pt; height: 26.5pt'>
                    <p align="center" style='text-align: center;'>
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>备案事项名称</span></p>
                </td>
            </tr>
            <tr id="tr2">
                <td>
                    &nbsp;
                </td>
                <td colspan="2" valign="top" style='border-top: none; border-left: solid windowtext 1.0pt;
                    border-bottom: solid windowtext 1.0pt; border-right: solid black 1.0pt; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    <p align="left" style='text-align: left;'>
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>备案事项主要内容</span>
                    </p>
                    <p align="left" style='text-align: left;'>
                        <asp:TextBox runat="server" ID="tbMainContent" Rows="11" TextMode="MultiLine" Width="98%"
                            CssClass="TextboxLine"></asp:TextBox>
                    </p>
                    <p align="left" style='text-align: left;'>
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>上报单位领导签名：</span><span>
                            <asp:TextBox runat="server" ID="tbSign" Width="200" CssClass="TextboxLine"></asp:TextBox>
                        </span>
                    </p>
                    <p align="left" style='text-align: left;'>
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>（附事项具体材料）</span>
                        <% if (CanUpload == "0")
                           { %><span lang="EN-US" style='font-size: 14.0pt; font-family: 宋体;'>
                               <input id="file_upload" name="file_upload" type="file" /></span>
                        <%} %><span>
                            <ul id="ulAtt" class="ulAtt">
                            </ul>
                        </span>
                    </p>
                </td>
            </tr>
            <tr runat="server" id="trLeaderPart">
                <td>
                    &nbsp;
                </td>
                <td colspan="2" valign="top" style='border-top: none; border-left: solid windowtext 1.0pt;
                    border-bottom: solid windowtext 1.0pt; border-right: solid black 1.0pt; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    <p>
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>审阅意见</span><span style='font-size: 14.0pt;
                            font-family: 宋体;'> </span>
                    </p>
                    <p>
                        <asp:TextBox runat="server" ID="tbSug" Rows="5" TextMode="MultiLine" Width="98%"
                            CssClass="TextboxLine"></asp:TextBox>
                    </p>
                    <p style="text-align:right">
                        <span style='font-size: 14.0pt; font-family: 仿宋_GB2312;'>日期：</span><span style='font-size: 14.0pt;
                            font-family: 宋体;'><asp:TextBox runat="server" ID="tbSugTime" Width="160" CssClass="TextboxLine"></asp:TextBox></span></p>
                </td>
            </tr>
        </table>
        <table id="template2" style="display: none">
            <tr name="template2" style='height: 31.35pt'>
                <td>
                    <%if (CanUpload == "0")
                      { %>
                    <input type="button" class="Button01" onclick="deleteTr(this)" value="删除" /><%} %>
                </td>
                <td style='border: solid windowtext 1.0pt; border-top: none; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    t0
                </td>
                <td style='border-top: none; border-left: none; border-bottom: solid windowtext 1.0pt;
                    border-right: solid black 1.0pt; padding: 0cm 5.4pt 0cm 5.4pt;'>
                    <input type="text" id="t02" name="t02" class="TextboxLine" style="width: 95%" />
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content8" ContentPlaceHolderID="Div2ContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content9" ContentPlaceHolderID="Div3ContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content10" ContentPlaceHolderID="Div4ContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content11" ContentPlaceHolderID="Div5ContentPlaceHolder" runat="server">
</asp:Content>
<asp:Content ID="Content12" ContentPlaceHolderID="TabberJSContentPlaceHolder" runat="server">
</asp:Content>
